<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('员工工资统计')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
    <div class="ui-layout-west">
        <div class="box box-main">
            <div class="box-header">
                <div class="box-title">
                    <i class="fa icon-grid"></i> 组织机构
                </div>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
                </div>
            </div>
            <div class="ui-layout-content">
                <div id="tree" class="ztree"></div>
            </div>
        </div>
    </div>
    <div class="ui-layout-center">
         <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse">
                    <form id="formId">
                        <input type="hidden" id="deptId" name="deptId">
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>工号：</label>
                                    <input type="text" name="userNo"/>
                                </li>
                                <li>
                                    <label>姓名：</label>
                                    <input type="text" name="userName"/>
                                </li>
                                <li>
                                    <label>性别：</label>
                                    <select name="userSex" th:with="type=${@dict.getType('sys_user_sex')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>用户类别：</label>
                                    <select name="userType" th:with="type=${@dict.getType('basic_user_type')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>技术类别：</label>
                                    <select name="technicalType" th:with="type=${@dict.getType('basic_user_technical')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>编制情况：</label>
                                    <select name="workDuty" th:with="type=${@dict.getType('basic_work_duty')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>职务级别：</label>
                                    <select name="dutyLevel" th:with="type=${@dict.getType('basic_duty_level')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>职位类别：</label>
                                    <select name="userPosition" th:with="type=${@dict.getType('basic_user_position')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>聘任等级：</label>
                                    <select name="postLevel" th:with="type=${@dict.getType('basic_post_level')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li class="select-time">
                                    <label>出生日期： </label>
                                    <input type="text" class="time-input" id="startTime1" placeholder="开始时间" name="params[beginTime1]"/>
                                    <span>-</span>
                                    <input type="text" class="time-input" id="endTime1" placeholder="结束时间" name="params[endTime1]"/>
                                </li>
                                <li class="select-time">
                                    <label>来院时间： </label>
                                    <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                                    <span>-</span>
                                    <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                                </li>
                                <li class="select-time">
                                    <label>统计月份： </label>
                                    <input type="text" class="time-input" id="startTime2" data-type="month" th:value="${startMonth}" placeholder="开始时间" name="params[beginTime2]"/>
                                    <span>-</span>
                                    <input type="text" class="time-input" id="endTime2" data-type="month" th:value="${endMonth}" placeholder="结束时间" name="params[endTime2]"/>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>

                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
                <div class="col-sm-12 select-table table-striped">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: layout-latest-js" />
    <th:block th:include="include :: ztree-js" />
    <th:block th:include="include :: bootstrap-table-export-js" />
    <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
    <script th:inline="javascript">
        var prefix = ctx + "report/salary";

        var sexs = [[${@dict.getType('sys_user_sex')}]];
        var types = [[${@dict.getType('basic_user_type')}]];
        var technicals = [[${@dict.getType('basic_user_technical')}]];
        var workDutys = [[${@dict.getType('basic_work_duty')}]];
        var dutyLevelDatas = [[${@dict.getType('basic_duty_level')}]];
        var postLevelDatas = [[${@dict.getType('basic_post_level')}]];

        $(function() {
            var panehHidden = false;
            if ($(this).width() < 769) {
                panehHidden = true;
            }
            $('body').layout({ initClosed: panehHidden, west__size: 185 });
            // 回到顶部绑定
            if ($.fn.toTop !== undefined) {
                var opt = {
                    win:$('.ui-layout-center'),
                    doc:$('.ui-layout-center')
                };
                $('#scroll-up').toTop(opt);
            }
            querySalaryList();
            queryDeptTree();
        });

        
        function querySalaryList() {
            var options = {
                url: prefix + "/list",
                exportUrl: prefix + "/export",
                modalName: "工资信息",
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                showExport: false,
                fixedColumns: true,
                fixedNumber: 3,
                columns: [
                    [
                        {
                            title : '基本信息',
                            align : 'center',
                            valign : 'center',
                            colspan : 13,

                        },
                        {
                            title : '在职职工',
                            align : 'center',
                            valign : 'center',
                            colspan : 36
                        },
                        {
                            title : '退休职工',
                            align : 'center',
                            valign : 'center',
                            colspan : 30
                        },
                        {
                            title : '铁路退休',
                            align : 'center',
                            valign : 'center',
                            colspan : 35
                        },
                        {
                            title : '临时工',
                            align : 'center',
                            valign : 'center',
                            colspan : 10
                        }
                    ],
                    [
                        {
                            field: 'salaryMonth',
                            title: '工资月份'
                        },
                        {
                            field: 'userNo',
                            title: '工号'
                        },
                        {
                            field: 'userName',
                            title: '姓名'
                        },
                        {
                            field: 'userSex',
                            title: '性别',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(sexs, value);
                            }
                        },
                        {
                            field: 'userType',
                            title: '用户类别',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(types, value);
                            }
                        },
                        {
                            field: 'idCard',
                            title: '身份证号'
                        },
                        {
                            field: 'birthday',
                            title: '出生年月'
                        },
                        {
                            field: 'technicalType',
                            title: '技术类别',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(technicals, value);
                            }
                        },
                        {
                            field: 'hospitalTime',
                            title: '来院时间'
                        },
                        {
                            field: 'workDuty',
                            title: '编制情况',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(workDutys, value);
                            }
                        },
                        {
                            field: 'dutyLevel',
                            title: '级别',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(dutyLevelDatas, value);
                            }
                        },
                        {
                            field: 'obtainLevel',
                            title: '职称聘任等级',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(postLevelDatas, value);
                            }
                        },
                        {
                            field: 'postLevel',
                            title: '职称聘任等级',
                            formatter: function(value, row, index) {
                                return $.table.selectDictLabel(postLevelDatas, value);
                            }
                        },
                        {
                            field: 'a0',
                            title: '薪级工资'
                        },
                        {
                            field: 'a1',
                            title: '教护百分之十'
                        },
                        {
                            field: 'a2',
                            title: '基础绩效'
                        },
                        {
                            field: 'a31',
                            title: '基础绩效奖'
                        },
                        {
                            field: 'a3',
                            title: '岗位工资'
                        },
                        {
                            field: 'a4',
                            title: '效益工资四'
                        },
                        {
                            field: 'a5',
                            title: '夜班绩效'
                        },
                        {
                            field: 'a6',
                            title: '管理绩效'
                        },
                        {
                            field: 'a7',
                            title: '门诊考核绩效'
                        },
                        {
                            field: 'a8',
                            title: '会诊绩效'
                        },
                        {
                            field: 'a9',
                            title: '效益工资一'
                        },
                        {
                            field: 'a10',
                            title: '效益工资二'
                        },
                        {
                            field: 'a11',
                            title: '效益工资三'
                        },
                        {
                            field: 'a12',
                            title: '保健'
                        },
                        {
                            field: 'a13',
                            title: '发一'
                        },
                        {
                            field: 'a14',
                            title: '发二'
                        },
                        {
                            field: 'a15',
                            title: '发三'
                        },
                        {
                            field: 'a16',
                            title: '公务交贴'
                        },
                        {
                            field: 'a17',
                            title: '取暖费'
                        },
                        {
                            field: 'a18',
                            title: '独子'
                        },
                        {
                            field: 'a19',
                            title: '应发合计'
                        },
                        {
                            field: 'a20',
                            title: '会费'
                        },
                        {
                            field: 'a21',
                            title: '养老保险'
                        },
                        {
                            field: 'a22',
                            title: '医疗保险'
                        },
                        {
                            field: 'a23',
                            title: '失业保险'
                        },
                        {
                            field: 'a24',
                            title: '住房公积金'
                        },
                        {
                            field: 'a25',
                            title: '扣二'
                        },
                        {
                            field: 'a26',
                            title: '扣减'
                        },
                        {
                            field: 'a27',
                            title: '个人所得税'
                        },
                        {
                            field: 'a28',
                            title: '扣款合计'
                        },
                        {
                            field: 'a29',
                            title: '实发合计'
                        },
                        {
                            field: 'a30',
                            title: '计税基数'
                        },
                        {
                            field: 'a32',
                            title: '工资所属日'
                        },
                        {
                            field: 'a33',
                            title: '爱心一日捐'
                        },
                        {
                            field: 'a34',
                            title: '职业年金'
                        },
                        {
                            field: 'a35',
                            title: '在附5'
                        },
                        {
                            field: 'b1',
                            title: '月增离退休费'
                        },
                        {
                            field: 'b2',
                            title: '月增离退休补贴'
                        },
                        {
                            field: 'b3',
                            title: '物业补贴'
                        },
                        {
                            field: 'b4',
                            title: '退休补贴2'
                        },
                        {
                            field: 'b5',
                            title: '零五岗'
                        },
                        {
                            field: 'b6',
                            title: '按年龄增加'
                        },
                        {
                            field: 'b7',
                            title: '保留部分'
                        },
                        {
                            field: 'b8',
                            title: '护龄'
                        },
                        {
                            field: 'b9',
                            title: '房贴'
                        },
                        {
                            field: 'b10',
                            title: '房贴二'
                        },
                        {
                            field: 'b11',
                            title: '统一补贴'
                        },
                        {
                            field: 'b12',
                            title: '过节费'
                        },
                        {
                            field: 'b13',
                            title: '薪级工资'
                        },
                        {
                            field: 'b14',
                            title: '岗位津贴'
                        },
                        {
                            field: 'b15',
                            title: '零七增资'
                        },
                        {
                            field: 'b16',
                            title: '零八增资'
                        },
                        {
                            field: 'b17',
                            title: '遗属补助'
                        },
                        {
                            field: 'b18',
                            title: '补发'
                        },
                        {
                            field: 'b19',
                            title: '退休预支金'
                        },
                        {
                            field: 'b20',
                            title: '党支部工作补助'
                        },
                        {
                            field: 'b21',
                            title: '应发合计'
                        },
                        {
                            field: 'b22',
                            title: '扣二'
                        },
                        {
                            field: 'b23',
                            title: '大病保险'
                        },
                        {
                            field: 'b24',
                            title: '扣款合计'
                        },
                        {
                            field: 'b25',
                            title: '实发合计'
                        },
                        {
                            field: 'b26',
                            title: '年终奖'
                        },
                        {
                            field: 'b27',
                            title: '爱心一日捐'
                        },
                        {
                            field: 'b28',
                            title: '退附2'
                        },
                        {
                            field: 'b29',
                            title: '退附3'
                        },
                        {
                            field: 'b30',
                            title: '退附4'
                        },
                        {
                            field: 'c1',
                            title: '月增离退休费'
                        },
                        {
                            field: 'c2',
                            title: '国发八二号'
                        },
                        {
                            field: 'c3',
                            title: '工龄工资'
                        },
                        {
                            field: 'c4',
                            title: '九三工改增发'
                        },
                        {
                            field: 'c5',
                            title: '零六工改增发'
                        },
                        {
                            field: 'c6',
                            title: '月增离退休补贴'
                        },
                        {
                            field: 'c7',
                            title: '护龄津贴'
                        },
                        {
                            field: 'c8',
                            title: '三次职务补贴'
                        },
                        {
                            field: 'c9',
                            title: '零四岗'
                        },
                        {
                            field: 'c10',
                            title: '零五岗'
                        },
                        {
                            field: 'c11',
                            title: '生活补贴'
                        },
                        {
                            field: 'c12',
                            title: '地方补贴'
                        },
                        {
                            field: 'c13',
                            title: '物业补贴'
                        },
                        {
                            field: 'c14',
                            title: '工资附加'
                        },
                        {
                            field: 'c15',
                            title: '按年龄增加离退休费'
                        },
                        {
                            field: 'c16',
                            title: '乘车费'
                        },
                        {
                            field: 'c17',
                            title: '小房贴'
                        },
                        {
                            field: 'c18',
                            title: '房贴'
                        },
                        {
                            field: 'c19',
                            title: '护理费'
                        },
                        {
                            field: 'c20',
                            title: '统一补贴'
                        },
                        {
                            field: 'c21',
                            title: '节日费'
                        },
                        {
                            field: 'c22',
                            title: '离休待遇'
                        },
                        {
                            field: 'c23',
                            title: '移交互济'
                        },
                        {
                            field: 'c24',
                            title: '发一'
                        },
                        {
                            field: 'c25',
                            title: '一次性防暑降温费'
                        },
                        {
                            field: 'c26',
                            title: '应发合计'
                        },
                        {
                            field: 'c27',
                            title: '扣一'
                        },
                        {
                            field: 'c28',
                            title: '扣款合计'
                        },
                        {
                            field: 'c29',
                            title: '实发合计'
                        },
                        {
                            field: 'c30',
                            title: '年终奖'
                        },
                        {
                            field: 'c31',
                            title: '爱心一日捐'
                        },
                        {
                            field: 'c32',
                            title: '铁附2'
                        },
                        {
                            field: 'c33',
                            title: '铁附3'
                        },
                        {
                            field: 'c34',
                            title: '铁附4'
                        },
                        {
                            field: 'c35',
                            title: '铁附5'
                        },
                        {
                            field: 'd1',
                            title: '应发金额'
                        },
                        {
                            field: 'd2',
                            title: '疫情防控补贴'
                        },
                        {
                            field: 'd3',
                            title: '实发金额'
                        },
                        {
                            field: 'd4',
                            title: '岗位'
                        },
                        {
                            field: 'd5',
                            title: '补贴'
                        },
                        {
                            field: 'd6',
                            title: '夜班'
                        },
                        {
                            field: 'd7',
                            title: '绩效'
                        },
                        {
                            field: 'd8',
                            title: '总额'
                        },
                        {
                            field: 'd9',
                            title: '爱心一日捐'
                        },
                        {
                            field: 'd10',
                            title: '临附2'
                        }
                    ]
                ]
            };
            $.table.init(options);
        }

        function queryDeptTree()
        {
            var url = ctx + "system/dept/treeData";
            var options = {
                url: url,
                expandLevel: 1,
                onClick : zOnClick
            };
            $.tree.init(options);

            function zOnClick(event, treeId, treeNode) {
                $("#deptId").val(treeNode.id);
                $.table.search();
            }
        }

        $('#btnExpand').click(function() {
            $._tree.expandAll(true);
            $(this).hide();
            $('#btnCollapse').show();
        });

        $('#btnCollapse').click(function() {
            $._tree.expandAll(false);
            $(this).hide();
            $('#btnExpand').show();
        });

        $('#btnRefresh').click(function() {
            queryDeptTree();
        });
    </script>
</body>
</html>